import { createRouter, createWebHistory } from 'vue-router'

//配置元素据
const routes = [
    {
        path: '/',
        name: 'home',
        component: () => import('../views/Home.vue'),
        //show 表示是否在菜单中显示，Frame 表示是否是全屏展示 默认为false
        meta: { title: '首页', icon: 'House', show: true, Frame: false }
    },
    {
        path: '/moveHome',
        name: 'moveHome',
        component: () => import('../views/movemall/MoveHome.vue'),
        //show 表示是否在菜单中显示，Frame 表示是否是全屏展示 默认为false
        meta: { title: '移动端首页', icon: 'House', show: false, Frame: true }
    },
    {
        path: '/moveVideo',
        name: 'moveVideo',
        component: () => import('../views/movemall/MoveVideo.vue'),
        //show 表示是否在菜单中显示，Frame 表示是否是全屏展示 默认为false
        meta: { title: '移动端视频详情', icon: 'House', show: false, Frame: true }
    },
    {
        path: '/movedeitel',
        name: 'movedeitel',
        component: () => import('../views/movemall/Movedeitel.vue'),
        //show 表示是否在菜单中显示，Frame 表示是否是全屏展示 默认为false
        meta: { title: '移动端视频详情', icon: 'House', show: false, Frame: true }
    },
    {
        path: '/moveCart',
        name: 'moveCart',
        component: () => import('../views/movemall/MoveCart.vue'),
        //show 表示是否在菜单中显示，Frame 表示是否是全屏展示 默认为false
        meta: { title: '购物车', icon: 'House', show: false, Frame: true }
    },
    {
        path: '/category',
        component: () => import('../views/category/Index.vue'),
        //show 表示是否在菜单中显示，Frame 表示是否是全屏展示 默认为false
        meta: { title: '类目管理', icon: 'Share', show: true, Frame: false },
        children: [
            {
                path: '/category/list',
                name: 'categoryList',
                component: () => import('../views/category/List.vue'),
                meta:{title:'类目列表',icon:'List',show:true}
            },
            {
                path: '/category/add',
                name: 'categoryAdd',
                component: () => import('../views/category/Add.vue'),
                meta: { title: '类目新增', icon: 'Plus', show: true }
            }, {
                path: '/category/edit',
                name: 'categoryEdit',
                component: () => import('../views/category/Edit.vue'),
                meta: { title: '类目编辑', icon: 'Edit', show: false }
            },
        ]
    },
    {
        path: '/product',
        component: () => import('../views/product/Index.vue'),
        //show 表示是否在菜单中显示，Frame 表示是否是全屏展示 默认为false
        meta: { title: '商品管理', icon: 'Iphone', show: true, Frame: false },
        children: [
            {
                path: '/product/list',
                name: 'productList',
                component: () => import('../views/product/List.vue'),
                meta: { title: '商品列表', icon: 'List', show: true }
            },
            {
                path: '/product/add',
                name: 'productAdd',
                component: () => import('../views/product/Add.vue'),
                meta: { title: '商品新增', icon: 'Plus', show: true }
            }, {
                path: '/product/edit',
                name: 'productEdit',
                component: () => import('../views/product/Edit.vue'),
                meta: { title: '商品编辑', icon: 'Edit', show: false }
            },
        ]
    },
    {
        path: '/videos',
        component: () => import('../views/videos/Index.vue'),
        //show 表示是否在菜单中显示，Frame 表示是否是全屏展示 默认为false
        meta: { title: '视频管理', icon: 'DataBoard', show: true, Frame: false },
        children: [
            {
                path: '/videos/list',
                name: 'videosList',
                component: () => import('../views/videos/List.vue'),
                meta: { title: '视频列表', icon: 'List', show: true }
            },
            {
                path: '/videos/add',
                name: 'videosAdd',
                component: () => import('../views/videos/Add.vue'),
                meta: { title: '视频新增', icon: 'Plus', show: true }
            }, {
                path: '/videos/edit',
                name: 'videosEdit',
                component: () => import('../views/videos/Edit.vue'),
                meta: { title: '视频编辑', icon: 'Edit', show: false }
            },
        ]
    },
]

// 创建路由
const router = createRouter({
    history: createWebHistory(),
    routes,
})

// 导出路由
export default router